<template>
  <view class="delivery-block" @click="handleDelivery">
    <view>{{ $t("order.distribution") }}</view>
    <view class="block-content">
      <text>{{ send_name }}</text>
      <i class="iconfont icon-arrow-right" style="color: #cdcdcd"></i>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: {
    diy_send_type: {
      type: Array,
      default: function () {
        return [];
      },
    },
    send_type: {
      type: String,
      default: "",
    },
  },
  computed: {
    send_name() {
      let { diy_send_type, send_type } = this,
        item = diy_send_type.find((el) => el.key === send_type);

      return item ? item.name : this.$t("order.method");

      // if (this.send_type == "express") {
      //   return this.$t("order.express");
      // }
      // if (this.send_type == "shop") {
      //   return this.$t("admin.pickUpShop");
      // }
      // if (this.send_type == "delivery") {
      //   return this.$t("mdAdmin.distribution");
      // }
      // return this.$t("order.method");
    },
  },
  filters: {},
  methods: {
    handleDelivery() {
      this.$emit("handleDelivery");
    },
  },
};
</script>

<style lang="scss" scoped>
.delivery-block {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 28rpx;
  font-family: PingFang SC;
  font-weight: 400;
  color: #262626;
  margin: 30rpx 0;

  .block-content {
    display: flex;
    align-items: center;

    image {
      width: 12rpx;
      height: 20rpx;
      margin-left: 20rpx;
    }
    .iconfont {
      font-size: 22rpx;
    }
  }
}
</style>
